package com.quan.weixin.model;

import java.io.Serializable;

import com.alibaba.fastjson.JSON;

/**
 * 创建二维码ticket
 * 
 * @author yhaoquan
 * 
 */
public class QrCodeTicket implements Serializable {
	
	public static void main(String[] args) {
		System.out.println(QrCodeTicket.sceneIntVal(604800L, "QR_SCENE", 2000));
		System.out.println(QrCodeTicket.sceneStrVal(604800L, "QR_STR_SCENE", "Hello"));
		System.out.println(QrCodeTicket.sceneIntVal("QR_SCENE", 2000));
		System.out.println(QrCodeTicket.sceneStrVal("QR_STR_SCENE", "Hello"));
	}

	private static final long serialVersionUID = 1L;

	private Long expire_seconds;

	private String action_name;

	private Object action_info;

	public QrCodeTicket() {
	}

	public QrCodeTicket(Long expire_seconds, String action_name,
			Object action_info) {
		super();
		this.expire_seconds = expire_seconds;
		this.action_name = action_name;
		this.action_info = action_info;
	}
	
	public QrCodeTicket(Long expire_seconds, String action_name) {
		super();
		this.expire_seconds = expire_seconds;
		this.action_name = action_name;
	}

	public QrCodeTicket(String action_name, Object action_info) {
		super();
		this.action_name = action_name;
		this.action_info = action_info;
	}

	public QrCodeTicket(String action_name) {
		super();
		this.action_name = action_name;
	}

	public static String sceneIntVal(Long expire_seconds, String action_name, Integer sceneValue) {
		return JSON.toJSONString(new QrCodeTicket(expire_seconds, action_name, new Ccene(new CceneInt(sceneValue))));
	}
	public static String sceneIntVal(Long expire_seconds, String action_name) {
		return JSON.toJSONString(new QrCodeTicket(expire_seconds, action_name));
	}
	public static String sceneStrVal(Long expire_seconds, String action_name, String sceneValue) {
		return JSON.toJSONString(new QrCodeTicket(expire_seconds, action_name, new Ccene(new CceneStr(sceneValue))));
	}
	public static String sceneStrVal(Long expire_seconds, String action_name) {
		return JSON.toJSONString(new QrCodeTicket(expire_seconds, action_name));
	}
	
	public static String sceneIntVal(String action_name, long sceneValue) {
		return JSON.toJSONString(new QrCodeTicket(action_name, new Ccene(new CceneInt(sceneValue))));
	}
	public static String sceneIntVal(String action_name) {
		return JSON.toJSONString(new QrCodeTicket(action_name));
	}
	public static String sceneStrVal(String action_name, String sceneValue) {
		return JSON.toJSONString(new QrCodeTicket(action_name, new Ccene(new CceneStr(sceneValue))));
	}
	public static String sceneStrVal(String action_name) {
		return JSON.toJSONString(new QrCodeTicket(action_name));
	}

	public Long getExpire_seconds() {
		return expire_seconds;
	}

	public void setExpire_seconds(Long expire_seconds) {
		this.expire_seconds = expire_seconds;
	}

	public String getAction_name() {
		return action_name;
	}

	public void setAction_name(String action_name) {
		this.action_name = action_name;
	}

	public Object getAction_info() {
		return action_info;
	}

	public void setAction_info(Object action_info) {
		this.action_info = action_info;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	
}

class Ccene {
	
	private Object scene ;
	
	public Ccene() {
	}

	public Ccene(Object scene) {
		super();
		this.scene = scene;
	}

	public Object getScene() {
		return scene;
	}

	public void setScene(Object scene) {
		this.scene = scene;
	}
	
}

class CceneInt {
	private long scene_id;

	public CceneInt() {
	}

	public CceneInt(long scene_id) {
		super();
		this.scene_id = scene_id;
	}

	public long getScene_id() {
		return scene_id;
	}

	public void setScene_id(long scene_id) {
		this.scene_id = scene_id;
	}

}

class CceneStr {
	private String scene_str;

	public CceneStr() {
	}

	public CceneStr(String scene_str) {
		super();
		this.scene_str = scene_str;
	}

	public String getScene_str() {
		return scene_str;
	}

	public void setScene_str(String scene_str) {
		this.scene_str = scene_str;
	}
}
